import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({

  beforeCreate() {
    console.log("vm-beforeCreate");
  },
  created() {
    console.log("vm-created");
  },
  beforeMount() {
    console.log("vm-beforeMount");
    // 在new Vue实例对象中this.$el能获取到
    console.log(this.$el);
  },
  mounted() {
    console.log("vm-mounted");
    console.log(this.$el);
  },
  beforeUpdate() {
    console.log("vm-beforeUpdate");
  },
  updated() {
    console.log("vm-updated");
  },
  beforeDestroy() {
    console.log("vm-beforeDestroy");
  },
  destroyed() {
    console.log("vm-destroyed");
  },
  render: h => h(App)
}).$mount('#app')

/* 
先加载父组件的beforeCreate created beforeMounte  子组件的beforeCreate created beforeMounte mounted
最后 父组件mounted

前四个声明周期钩子函数一定会发生

当视图发生改变，则触发beforeUpdate updated


*/